﻿// Copyright (c) Kona Framework Team. All rights reserved.
// For continued development and updates, visit http://www.codeplex.com/kona
// For a copy of the license please vist: http://www.codeplex.com/kona/license

namespace Kanaka.ResourceAccess.Reports.Queries.MdxStatements
{
    internal class UsCustomerCountsByStateForFiscalYearMdx
    {
        private const string MdxTemplate = @"select [Date].[Month of Year].Children  on 0, " +
                                         "[Customer].[Customer Geography].[Country].&[United States].Children on 1 " +
                                         "from [Adventure Works] " +
                                         "where ([Measures].[Customer Count],[Date].[Fiscal Year].&[@FiscalYear])";

        internal UsCustomerCountsByStateForFiscalYearMdx(Parameters.FiscalYear fiscalYear)
        {
            this.FiscalYear = fiscalYear;
        }


        internal Parameters.FiscalYear FiscalYear
        { get; private set; }

        public override string ToString()
        {
            return MdxTemplate.Replace(FiscalYear.ParameterName, FiscalYear.Value.ToString());
        }
    }
}